﻿//----------------------------------------------------------------
//CodeArt.
//
//Descrpton:
//
//Author:jianyi0115@163.com  
//Created: 2009-10-27
//
//修订记录: 
//
//----------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Data;
using System.Web;
using System.Collections.Specialized;
using System.Collections;


namespace CodeArt.SharePoint.MultiLanSupport
{

    /// <summary>
    /// 具有数据缓存的翻译类
    /// </summary>
    class CachedTranslator : ITranslator
    {

        LanMapper _mapper = new LanMapper();
       
        
        #region ITranslator Members

        public string Translate(string from, string toLan , out bool transSueecss)
        {
            Hashtable t = _mapper.GetCachedLanMap(toLan);

            if (t.ContainsKey(from))
            {
                transSueecss = true;
                return ""+t[from];

            }
            else
            {
                transSueecss = false;
                return null;
            }
        }

        #endregion
    }
}
